import sqlalchemy.types as types


class String(types.TypeDecorator):

    impl = types.String

    cache_ok = True

    def process_bind_param(self, value, dialect):
        if value is not None:
            value = str(value)
        return value
